<#compress>
<!DOCTYPE html>
<html>
<head>
    <#include "info/include.ftl"/>
    <!-- Theme JS files -->
    <script type="text/javascript" src="${base}/js/plugins/forms/styling/uniform.min.js"></script>
    <script type="text/javascript" src="${base}/js/plugins/buttons/spin.min.js"></script>
    <script type="text/javascript" src="${base}/js/plugins/buttons/ladda.min.js"></script>
</head>
<body style="background: white">
<div class="panel" style="border: none">
    <div class="ibox-content" style="padding: 10px;margin: 10px">
        <input  type="hidden" id="code" value="${command.code}" name="code" />
        <div class="row">
            <div class="col-xs-4">
                <div class="form-group">
                    <label class="display-block text-semibold" id="xyk">校园卡业务</label>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_cc">充值</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_gsjg">挂失/解挂</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_ls">流水查询</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_qr">二维码</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_sqkh">申请开户</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_kxx">卡信息</label></div>
                </div>
            </div>
            <div class="col-xs-4">
                <div class="form-group">
                    <label class="display-block text-semibold" id="jfyw">缴费业务</label>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_tc">学费</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_cg">校内代收费</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_sd">交水费</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_df">交电费</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_wf">校园网费</label></div>
                </div>
            </div>
            <div class="col-xs-4">
                <div class="form-group">
                    <label class="display-block text-semibold" id="fzgj">辅助工具</label>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_xxcj">信息采集</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_gz">工资查询</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_bz">补助查询</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_notice">通知公告</label></div>
                </div>
            </div>


        </div>
        <div class="row">
            <div class="col-xs-4">
                <div class="form-group">
                    <label class="display-block text-semibold" id="kqdq">考勤签到</label>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_hyqd">会议签到</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_gqqd">归寝签到</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_skqd">上课签到</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_tycp">体育测评</label></div>
                </div>
            </div>
            <div class="col-xs-4">
                <div class="form-group">
                    <label class="display-block text-semibold" id="sfyw">第三方业务</label>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_xndh">校园内导航</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_gybx">公寓报修</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_zssy">掌上师院</label></div>
                    <div class="checkbox"><label><input type="checkbox" class="styled" id="has_zhhq">智慧后勤</label></div>
                </div>
            </div>
            <div class="col-xs-4">
                <#--<div class="form-group">-->
                    <#--<label class="display-block text-semibold">其他模块</label>-->
                    <#--<div class="checkbox"><label><input type="checkbox" class="styled" id="has_xx">消息提示</label></div>-->
                <#--</div>-->
            </div>
        </div>

    </div>
    <div style="width: 80%;margin: 0 auto;text-align: center">
        <button style="width: 120px;" class="btn btn-primary btn-ladda btn-ladda-spinner" data-style="expand-right" data-spinner-color="#333" data-spinner-size="20" type="button" onclick="save()">提交</button>
        <button style="width: 120px;" class="btn btn-default"  type="button" onclick="dialogClose();">关闭</button>
    </div>

</div>

<script>
    $(function () {
        var features='${command.features}';
        if(features){
            var features_obj=$.parseJSON(features);
            for(var i in features_obj){
                $('#'+i).attr('checked','checked');
            }
        }
        $(".styled").uniform({
            radioClass: 'choice',
            wrapperClass: 'border-success-600 text-success-800'
        });
    });
    function save() {



        if($('input[type=checkbox]:checked').size()==0){
            alertError('请选择模块');
            return;
        }
        var features={};
        $('input[type=checkbox]:checked').each(function () {
            var id=$(this).attr('id');
            features[id]=true;
        });
        $('.text-semibold').each(function () {
            var size = $(this).closest('.form-group').find('input[type=checkbox]:checked').size();
            if(size>0){
                var id = $(this).attr('id');
                if(id){
                    features[id]=true;
                }
            }
        })
        var data={
            code:$('#code').val(),
            features:JSON.stringify(features)
        }
        var l = Ladda.create( document.querySelector( '.btn-ladda-spinner' ) );
        l.start();
        post('pl/platform/setPlatsFeature',data,function (result) {
            if(result.code==0){
                parent.table.ajax.reload();
                dialogClose();
            }else{
                alertError(result.message);
            }
            l.stop();
        });

    }
</script>
</body>
</html>
</#compress>